Skip to content

Conversation

clue
Copy link
Owner

@clue clue commented Feb 15, 2025

This changeset adds support for cloning an existing RedisClient instance using the clone keyword:

$original = new Clue\React\Redis\RedisClient($uri);
$redis = clone $original;

This can be especially useful if the original connection is used for a PubSub subscription or when using blocking commands or similar and you need a control connection that is not affected by any of this.

The implementation is relatively straight-forward. Major effort went into documenting this feature thoroughly and testing to avoid any unintended side effects. If you enjoy this work, consider supporting this project, for example by becoming a sponsor ❤️

Builds on top of #166, #163, #129 and others
Refs #118

@clue
Copy link
Owner Author

clue commented Feb 22, 2025

Rebased to resolve unrelated build error now that #173 is merged :shipit:

@clue clue requested a review from PaulRotmann February 22, 2025 12:29
Copy link
Collaborator

@PaulRotmann PaulRotmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that the tests run, the change LGTM.

@PaulRotmann PaulRotmann merged commit 5533a0c into clue:3.x Feb 22, 2025
18 checks passed
@clue clue deleted the clone branch February 22, 2025 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants